package String;

/**
 * Created by LeeXyan on 2017/7/18 0018 17:19
 */
public class StringTest {
    public static void main(String[] args) {
        String x = "abcd";
        String y= "abcd";
        System.out.println(x==y);//true
        System.out.println(x.equals(y));//true

        String a = new String("abcd");
        String b = new String("abcd");
        System.out.println(a==b);//false
        System.out.println(a.equals(b));//true


        String c = new String("abcd").intern();
        String d = new String("abcd").intern();

        System.out.println(c == d);  // true
        System.out.println(c.equals(d)); //True

        String e="";
        System.out.println(e.equals(""));
    }
}
